'use strict'
  class ShopService {
    constructor(rpc_client) {
      this.rpc_client = rpc_client
    }
    /**
    * 查询店铺信息
    * @params shopId 店铺Id
    * @return
    */
    getShop(shopId) {
      return this.rpc_client.request("eleme.shop.getShop", {
        shopId: shopId,
      })
    }
    /**
    * 更新店铺基本信息
    * @params shopId 店铺Id
    * @params properties 店铺属性
    * @return
    */
    updateShop(shopId, properties) {
      return this.rpc_client.request("eleme.shop.updateShop", {
        shopId: shopId,
        properties: properties,
      })
    }
    /**
    * 批量获取店铺简要
    * @params shopIds 店铺Id的列表
    * @return
    */
    mgetShopStatus(shopIds) {
      return this.rpc_client.request("eleme.shop.mgetShopStatus", {
        shopIds: shopIds,
      })
    }
    /**
    * 设置送达时间
    * @params shopId 店铺Id
    * @params deliveryBasicMins 配送基准时间(单位分钟)
    * @params deliveryAdjustMins 配送调整时间(单位分钟)
    * @return
    */
    setDeliveryTime(shopId, deliveryBasicMins, deliveryAdjustMins) {
      return this.rpc_client.request("eleme.shop.setDeliveryTime", {
        shopId: shopId,
        deliveryBasicMins: deliveryBasicMins,
        deliveryAdjustMins: deliveryAdjustMins,
      })
    }
    /**
    * 设置是否支持在线退单
    * @params shopId 店铺Id
    * @params enable 是否支持
    * @return
    */
    setOnlineRefund(shopId, enable) {
      return this.rpc_client.request("eleme.shop.setOnlineRefund", {
        shopId: shopId,
        enable: enable,
      })
    }
    /**
    * 设置是否支持预定单及预定天数
    * @params shopId 店铺id
    * @params enabled 是否支持预订
    * @params maxBookingDays 最大预定天数
    * @return
    */
    setBookingStatus(shopId, enabled, maxBookingDays) {
      return this.rpc_client.request("eleme.shop.setBookingStatus", {
        shopId: shopId,
        enabled: enabled,
        maxBookingDays: maxBookingDays,
      })
    }
    /**
    * 批量通过店铺Id获取Oid
    * @params shopIds 店铺Id的列表
    * @return
    */
    getOidByShopIds(shopIds) {
      return this.rpc_client.request("eleme.shop.getOidByShopIds", {
        shopIds: shopIds,
      })
    }
    /**
    * 更新店铺营业时间预设置
    * @params shopId 店铺id
    * @params weekSetting 一周营业时间预设置, 参考 OShopBusyLevelSetting weekSetting 字段定义 
    * @params dateSetting 特定日期营业时间预设置, 参考 OShopBusyLevelSetting dateSetting 字段定义 
    * @return
    */
    updateBusyLevelSetting(shopId, weekSetting, dateSetting) {
      return this.rpc_client.request("eleme.shop.updateBusyLevelSetting", {
        shopId: shopId,
        weekSetting: weekSetting,
        dateSetting: dateSetting,
      })
    }
    /**
    * 获取店铺营业时间预设置
    * @params shopId 店铺id
    * @return
    */
    getBusyLevelSetting(shopId) {
      return this.rpc_client.request("eleme.shop.getBusyLevelSetting", {
        shopId: shopId,
      })
    }
    /**
    * 设置品牌排序权重
    * @params shopId 店铺Id
    * @params weight 权重值(取值范围[0~10])
    * @return
    */
    setBrandRankWeight(shopId, weight) {
      return this.rpc_client.request("eleme.shop.setBrandRankWeight", {
        shopId: shopId,
        weight: weight,
      })
    }
    /**
    * 获取店铺可补贴配送费的标品及补贴上限
    * @params shopId 店铺Id
    * @return
    */
    getProductSubsidyLimit(shopId) {
      return this.rpc_client.request("eleme.shop.getProductSubsidyLimit", {
        shopId: shopId,
      })
    }
    /**
    * 设置店铺T模型
    * @params shopId 店铺Id
    * @params deliveryTime 配送总时间(单位:分钟)
    * @return
    */
    setShopTModel(shopId, deliveryTime) {
      return this.rpc_client.request("eleme.shop.setShopTModel", {
        shopId: shopId,
        deliveryTime: deliveryTime,
      })
    }
    /**
    * 设置店铺假期歇业
    * @params shopId 店铺Id
    * @params vocationDates  店铺休假日期
    * @params enabled  店铺休假是否有效
    * @return
    */
    setShopVocations(shopId, vocationDates, enabled) {
      return this.rpc_client.request("eleme.shop.setShopVocations", {
        shopId: shopId,
        vocationDates: vocationDates,
        enabled: enabled,
      })
    }
    /**
    * 获取店铺有效的假期歇业日期
    * @params shopId 店铺Id
    * @return
    */
    getShopVocation(shopId) {
      return this.rpc_client.request("eleme.shop.getShopVocation", {
        shopId: shopId,
      })
    }
    /**
    * 提交开店申请接口
    * @params openStoreMessage 开店申请表单
    * @return
    */
    submitOpenStoreMessageAudit(openStoreMessage) {
      return this.rpc_client.request("eleme.shop.setup.submitOpenStoreMessageAudit", {
        openStoreMessage: openStoreMessage,
      })
    }
    /**
    * 星巴克提交开店申请接口
    * @params openStoreMessage 开店申请表单
    * @return
    */
    submitOpenStoreForMermaid(openStoreMessage) {
      return this.rpc_client.request("eleme.shop.setup.submitOpenStoreForMermaid", {
        openStoreMessage: openStoreMessage,
      })
    }
    /**
    * 更新申请信息接口
    * @params updateStoreMessageBody 开店申请表单
    * @return
    */
    updateOpenStoreMessageAudit(updateStoreMessageBody) {
      return this.rpc_client.request("eleme.shop.setup.updateOpenStoreMessageAudit", {
        updateStoreMessageBody: updateStoreMessageBody,
      })
    }
    /**
    * 查询请求状态接口
    * @params submitId 请求提交id
    * @return
    */
    queryProcessStatusBySubmitId(submitId) {
      return this.rpc_client.request("eleme.shop.setup.queryProcessStatusBySubmitId", {
        submitId: submitId,
      })
    }
    /**
    * 图片上传处理接口（5M以内图片）
    * @params imageBase64 base64字节流
    * @return
    */
    uploadImage(imageBase64) {
      return this.rpc_client.request("eleme.shop.setup.uploadImage", {
        imageBase64: imageBase64,
      })
    }
    /**
    * 图片上传处理接口（500K以内图片）
    * @params imageBase64 base64字节流
    * @return
    */
    uploadMinImage(imageBase64) {
      return this.rpc_client.request("eleme.shop.setup.uploadMinImage", {
        imageBase64: imageBase64,
      })
    }
    /**
    * 远程上传图片接口
    * @params url 图片url
    * @return
    */
    uploadImageWithRemoteUrl(url) {
      return this.rpc_client.request("eleme.shop.setup.uploadImageWithRemoteUrl", {
        url: url,
      })
    }
}

module.exports = ShopService